﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Construction.Core
{
    public class iBearing: cObj
    {
        private List<iBearing> contents;
        private string name;
        private double kichthuoctren;
        private double kichthuocduoi;
        private string id;
        public iBearing()
        {
            contents = new List<iBearing>();
        }
        public double Kichthuoctren
        {
            set
            {
                if (!(this.kichthuoctren == value))
                {
                    this.kichthuoctren = value;
                    this.id = null;
                }
            }
            get
            {
                return this.kichthuoctren;
            }
        }

        public double Kichthuocduoi
        {
            set
            {
                if (!(this.kichthuocduoi == value))
                {
                    this.kichthuocduoi = value;
                    this.id = null;
                }
            }
            get
            {
                return this.kichthuocduoi;
            }
        }
        
        public string Name
        {
            set
            {
                if (this.name != value)
                {
                    this.name = value;
                    this.id = null;
                }
            }
            get
            {
                return this.name;
            }
        }

        public string ID
        {
            get
            {
                if (this is iBearing)
                {
                    if (this.id == null)
                    {
                        this.id = Guid.NewGuid().ToString();
                        return id;
                    }
                }
                if (this.id == null)
                {
                    this.id = Guid.NewGuid().ToString();
                    return id;
                }
                return id;
            }
        }
    }
}
